<!--
 * @Descripttion: 模式修正符
 * @Author: YuZhenJing
 * @Date: 2020-07-04 17:09:22
 * @LastEditors: YuZhenJing
 * @LastEditTime: 2020-07-04 19:32:06
-->
<!DOCTYPE html>
<html lang="zh_CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>模式修正符</title>
  </head>
  <body>
    <script>
      let title_style = "font-weight: bold;color:yellow;";
      console.log("%c模式修正符：", title_style);
      let text = `
            Java:100元
            Js:88元
      `;
      console.log(text.match(/^\s*(\w+):(\d+).+\s*$/gim));
      let reg = /^\s*(?<language>\w+):(?<price>\d+).+\s*$/gim;
      for (const iterator of text.matchAll(reg)) {
        console.log(iterator["groups"]);
      }
    </script>
  </body>
</html>
